<template>
  <global-layout>
    <transition name="page-toggle" mode="out-in">
      <!-- <keep-alive :include="cacheList"> -->
      <keep-alive>
        <router-view />
      </keep-alive>
    </transition>
  </global-layout>
</template>

<script>
import GlobalLayout from './GlobalLayout';
export default {
  name: 'mainView',
  components: { GlobalLayout },
  data() {
    return {};
  },
  computed: {
    tagNavList() {
      return this.$store.state.app.tagNavList;
    },
    cacheList() {
      const list = [...(this.tagNavList.length ? this.tagNavList.filter(item => !(item.meta && item.meta.notCache)).map(item => item.name) : [])];
      return list;
    },
    isMultipage() {
      return this.$store.state.setting.multipage;
    }
  },
  created() {},
  watch: {
    isMultipage(newVal) {
      this.$bus.emit(this.$constant.BUS_EVENT.RESIZE, 2);
    }
  },
  mounted() {
    var me = this;
    window.onresize = () => {
      return (() => {
        me.$bus.emit(this.$constant.BUS_EVENT.RESIZE, 1);
      })();
    };
  },
  methods: {}
};
</script>

<style lang="less" scoped>
</style>
